home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / MacTCP.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  21.0 KB  |  614 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacTCP.a
  3. ;
  4. ;    Contains:    TCP Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    MacTCP 2.0.6
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1989-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__MACTCP__') = 'UNDEFINED' THEN
  19. __MACTCP__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  28.     include 'AppleTalk.a'
  29.     ENDIF
  30.  
  31. ;Developer Notes:
  32. ;        0. This MacTCP header replaces what used to be defined in the following header files
  33. ;            MacTCPCommonTypes.h
  34. ;            GetMyIPAddr.h
  35. ;            MiscIPPB.h
  36. ;            TCPPB.h
  37. ;            UDPPB.h 
  38. ;            
  39. ;            When the various control calls are made to the ip driver, you must set up a 
  40. ;            NewRoutineDescriptor for every non-nil completion routine and/or notifyProc parameter.  
  41. ;            Otherwise, the 68K driver code, will not correctly call your routine.
  42. ;        1. For ipctlGetAddr Control calls, use NewGetIPIOCompletionProc
  43. ;            to set up a GetIPIOCompletionUPP universal procptr to pass as
  44. ;            the ioCompletion parameter.
  45. ;        2. For the ipctlEchoICMP and ipctlLAPStats Control calls, use 
  46. ;            NewIPIOCompletion to set up a IPIOCompletionUPP universal procptr
  47. ;            to pass in the ioCompletion field of the parameter block.
  48. ;        3. For TCPCreatePB Control calls, use NewTCPNotifyProc to set up a
  49. ;            TCPNotifyUPP universal procptr to pass in the notifyProc field
  50. ;            of the parameter block
  51. ;        4. For all of the TCP Control calls using the TCPiopb parameter block,
  52. ;            use NewTCPIOCompletionProc to set up a TCPIOCompletionUPP
  53. ;            universal procptr to pass in the ioCompletion field of the paramter
  54. ;            block.
  55. ;        5. For UDBCreatePB Control calls, use NewUDPNotifyProc to set up a
  56. ;            UDPNotifyUPP universal procptr to pass in the notifyProc field
  57. ;            of the parameter block
  58. ;        6. For all of the UDP Control calls using the UDPiopb parameter block,
  59. ;            use NewUDPIOCompletionProc to set up a UDPIOCompletionUPP
  60. ;            universal procptr to pass in the ioCompletion field of the paramter
  61. ;            block.
  62. ;        7. For all calls implementing a notifyProc or ioCompletion routine
  63. ;            which was set up using a NewTCPRoutineProc call, do not call
  64. ;            DisposeRoutineSDescriptor on the universal procptr until
  65. ;            after the completion or notify proc has completed.
  66. ;
  67.  
  68.  
  69. ;  MacTCP return Codes in the range -23000 through -23049 
  70.  
  71. inProgress                        EQU        1                    ; I/O in progress 
  72. ipBadLapErr                        EQU        -23000                ; bad network configuration 
  73. ipBadCnfgErr                    EQU        -23001                ; bad IP configuration error 
  74. ipNoCnfgErr                        EQU        -23002                ; missing IP or LAP configuration error 
  75. ipLoadErr                        EQU        -23003                ; error in MacTCP load 
  76. ipBadAddr                        EQU        -23004                ; error in getting address 
  77. connectionClosing                EQU        -23005                ; connection is closing 
  78. invalidLength                    EQU        -23006
  79. connectionExists                EQU        -23007                ; request conflicts with existing connection 
  80. connectionDoesntExist            EQU        -23008                ; connection does not exist 
  81. insufficientResources            EQU        -23009                ; insufficient resources to perform request 
  82. invalidStreamPtr                EQU        -23010
  83. streamAlreadyOpen                EQU        -23011
  84. connectionTerminated            EQU        -23012
  85. invalidBufPtr                    EQU        -23013
  86. invalidRDS                        EQU        -23014
  87. invalidWDS                        EQU        -23014
  88. openFailed                        EQU        -23015
  89. commandTimeout                    EQU        -23016
  90. duplicateSocket                    EQU        -23017
  91. ;  Error codes from internal IP functions 
  92.  
  93. ipDontFragErr                    EQU        -23032                ; Packet too large to send w/o fragmenting 
  94. ipDestDeadErr                    EQU        -23033                ; destination not responding 
  95. icmpEchoTimeoutErr                EQU        -23035                ; ICMP echo timed-out 
  96. ipNoFragMemErr                    EQU        -23036                ; no memory to send fragmented pkt 
  97. ipRouteErr                        EQU        -23037                ; can't route packet off-net 
  98. nameSyntaxErr                    EQU        -23041
  99. cacheFault                        EQU        -23042
  100. noResultProc                    EQU        -23043
  101. noNameServer                    EQU        -23044
  102. authNameErr                        EQU        -23045
  103. noAnsErr                        EQU        -23046
  104. dnrErr                            EQU        -23047
  105. outOfMemory                        EQU        -23048
  106.  
  107.  
  108. BYTES_16WORD                    EQU        2                    ; bytes per = 16, bit ip word 
  109. BYTES_32WORD                    EQU        4                    ; bytes per = 32, bit ip word 
  110. BYTES_64WORD                    EQU        8                    ; bytes per = 64, bit ip word 
  111. ;  8-bit quantity 
  112. ; typedef UInt8                         b_8
  113.  
  114. ;  16-bit quantity 
  115. ; typedef UInt16                         b_16
  116.  
  117. ;  32-bit quantity 
  118. ; typedef UInt32                         b_32
  119.  
  120. ;  IP address is 32-bits 
  121. ; typedef b_32                             ip_addr
  122.  
  123. ip_addrbytes            RECORD 0
  124. addr                     ds.l    1                ; offset: $0 (0)
  125.                          ORG 0
  126. byte                     ds.b    4                ; offset: $0 (0)
  127. sizeof                     EQU *                    ; size:   $4 (4)
  128.                         ENDR
  129. wdsEntry                RECORD 0
  130. length                     ds.w    1                ; offset: $0 (0)        ;  length of buffer 
  131. ptr                         ds.l    1                ; offset: $2 (2)        ;  pointer to buffer 
  132. sizeof                     EQU *                    ; size:   $6 (6)
  133.                         ENDR
  134. rdsEntry                RECORD 0
  135. length                     ds.w    1                ; offset: $0 (0)        ;  length of buffer 
  136. ptr                         ds.l    1                ; offset: $2 (2)        ;  pointer to buffer 
  137. sizeof                     EQU *                    ; size:   $6 (6)
  138.                         ENDR
  139. ; typedef unsigned long                 BufferPtr
  140.  
  141. ; typedef unsigned long                 StreamPtr
  142.  
  143.  
  144. netUnreach                        EQU        0
  145. hostUnreach                        EQU        1
  146. protocolUnreach                    EQU        2
  147. portUnreach                        EQU        3
  148. fragReqd                        EQU        4
  149. sourceRouteFailed                EQU        5
  150. timeExceeded                    EQU        6
  151. parmProblem                        EQU        7
  152. missingOption                    EQU        8
  153. lastICMPMsgType                    EQU        32767
  154. ; typedef unsigned short                 ICMPMsgType
  155.  
  156. ; typedef b_16                             ip_port
  157.  
  158. ICMPReport                RECORD 0
  159. streamPtr                 ds.l    1                ; offset: $0 (0)
  160. localHost                 ds.l    1                ; offset: $4 (4)
  161. localPort                 ds.w    1                ; offset: $8 (8)
  162. remoteHost                 ds.l    1                ; offset: $A (10)
  163. remotePort                 ds.w    1                ; offset: $E (14)
  164. reportType                 ds.w    1                ; offset: $10 (16)
  165. optionalAddlInfo         ds.w    1                ; offset: $12 (18)
  166. optionalAddlInfoPtr         ds.l    1                ; offset: $14 (20)
  167. sizeof                     EQU *                    ; size:   $18 (24)
  168.                         ENDR
  169. ;  csCode to get our IP address 
  170.  
  171. ipctlGetAddr                    EQU        15
  172.  
  173.  
  174. GetAddrParamBlock        RECORD 0
  175. qLink                     ds.l    1                ; offset: $0 (0)
  176. qType                     ds.w    1                ; offset: $4 (4)
  177. ioTrap                     ds.w    1                ; offset: $6 (6)
  178. ioCmdAddr                 ds.l    1                ; offset: $8 (8)
  179. ioCompletion             ds.l    1                ; offset: $C (12)
  180. ioResult                 ds.w    1                ; offset: $10 (16)
  181. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  182. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  183. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  184. csCode                     ds.w    1                ; offset: $1A (26)
  185. ourAddress                 ds.l    1                ; offset: $1C (28)        ;  our IP address 
  186. ourNetMask                 ds.l    1                ; offset: $20 (32)        ;  our IP net mask 
  187. sizeof                     EQU *                    ; size:   $24 (36)
  188.                         ENDR
  189. ;  control codes 
  190.  
  191. ipctlEchoICMP                    EQU        17                    ; send icmp echo 
  192. ipctlLAPStats                    EQU        19                    ; get lap stats 
  193.  
  194.  
  195.  
  196. ICMPParamBlock            RECORD 0
  197. qLink                     ds.l    1                ; offset: $0 (0)
  198. qType                     ds.w    1                ; offset: $4 (4)
  199. ioTrap                     ds.w    1                ; offset: $6 (6)
  200. ioCmdAddr                 ds.l    1                ; offset: $8 (8)
  201. ioCompletion             ds.l    1                ; offset: $C (12)
  202. ioResult                 ds.w    1                ; offset: $10 (16)
  203. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  204. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  205. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  206. csCode                     ds.w    1                ; offset: $1A (26)
  207. params                     ds.w    11                ; offset: $1C (28)
  208. echoRequestOut             ds.l    1                ; offset: $32 (50)        ;  time in ticks of when the echo request went out 
  209. echoReplyIn                 ds.l    1                ; offset: $36 (54)        ;  time in ticks of when the reply was received 
  210. echoedData                 ds        rdsEntry        ; offset: $3A (58)        ;  data received in responce 
  211. options                     ds.l    1                ; offset: $40 (64)
  212. userDataPtr                 ds.l    1                ; offset: $44 (68)
  213. sizeof                     EQU *                    ; size:   $48 (72)
  214.                         ENDR
  215.  
  216.  
  217. IPParamBlock            RECORD 0
  218. qLink                     ds.l    1                ; offset: $0 (0)
  219. qType                     ds.w    1                ; offset: $4 (4)
  220. ioTrap                     ds.w    1                ; offset: $6 (6)
  221. ioCmdAddr                 ds.l    1                ; offset: $8 (8)
  222. ioCompletion             ds.l    1                ; offset: $C (12)
  223. ioResult                 ds.w    1                ; offset: $10 (16)
  224. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  225. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  226. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  227. csCode                     ds.w    1                ; offset: $1A (26)
  228. dest                     ds.l    1                ; offset: $1C (28)        ;  echo to IP address 
  229. data                     ds        wdsEntry        ; offset: $20 (32)
  230. timeout                     ds.w    1                ; offset: $26 (38)
  231. options                     ds.l    1                ; offset: $28 (40)
  232. optLength                 ds.w    1                ; offset: $2C (44)
  233. icmpCompletion             ds.l    1                ; offset: $2E (46)
  234. userDataPtr                 ds.l    1                ; offset: $32 (50)
  235.                          ORG 28
  236. lapStatsPtr                 ds.l    1                ; offset: $1C (28)
  237.                          ORG 54
  238. sizeof                     EQU *                    ; size:   $36 (54)
  239.                         ENDR
  240.  
  241. nbp_entry                RECORD 0
  242. ip_address                 ds.l    1                ; offset: $0 (0)        ;  IP address 
  243. at_address                 ds        AddrBlock        ; offset: $4 (4)        ;  matching AppleTalk address 
  244. gateway                     ds.b    1                ; offset: $8 (8)        ;  TRUE if entry for a gateway 
  245. valid                     ds.b    1                ; offset: $9 (9)        ;  TRUE if LAP address is valid 
  246. probing                     ds.b    1                ; offset: $A (10)        ;  TRUE if NBP lookup pending 
  247. afiller                     ds.b    1                ; offset: $B (11)        ;  Filler for proper byte alignment     
  248. age                         ds.l    1                ; offset: $C (12)        ;  ticks since cache entry verified 
  249. access                     ds.l    1                ; offset: $10 (16)        ;  ticks since last access 
  250. filler                     ds.b    116                ; offset: $14 (20)        ;  for internal use only !!! 
  251. sizeof                     EQU *                    ; size:   $88 (136)
  252.                         ENDR
  253. Enet_addr                RECORD 0
  254. en_hi                     ds.w    1                ; offset: $0 (0)
  255. en_lo                     ds.l    1                ; offset: $2 (2)
  256. sizeof                     EQU *                    ; size:   $6 (6)
  257.                         ENDR
  258. arp_entry                RECORD 0
  259. age                         ds.w    1                ; offset: $0 (0)        ;  cache aging field 
  260. protocol                 ds.w    1                ; offset: $2 (2)        ;  Protocol type 
  261. ip_address                 ds.l    1                ; offset: $4 (4)        ;  IP address 
  262. en_address                 ds        Enet_addr        ; offset: $8 (8)        ;  matching Ethernet address 
  263. sizeof                     EQU *                    ; size:   $E (14)
  264.                         ENDR
  265. LAPStatsAddrXlation        RECORD 0
  266. arp_table                 ds.l    1                ; offset: $0 (0)
  267.                          ORG 0
  268. nbp_table                 ds.l    1                ; offset: $0 (0)
  269. sizeof                     EQU *                    ; size:   $4 (4)
  270.                         ENDR
  271. LAPStats                RECORD 0
  272. ifType                     ds.w    1                ; offset: $0 (0)
  273. ifString                 ds.l    1                ; offset: $2 (2)
  274. ifMaxMTU                 ds.w    1                ; offset: $6 (6)
  275. ifSpeed                     ds.l    1                ; offset: $8 (8)
  276. ifPhyAddrLength             ds.w    1                ; offset: $C (12)
  277. ifPhysicalAddress         ds.l    1                ; offset: $E (14)
  278. AddrXlation                 ds        LAPStatsAddrXlation ; offset: $12 (18)
  279. slotNumber                 ds.w    1                ; offset: $16 (22)
  280. sizeof                     EQU *                    ; size:   $18 (24)
  281.                         ENDR
  282. ;  number of ARP table entries 
  283.  
  284. ARP_TABLE_SIZE                    EQU        20
  285.  
  286. NBP_TABLE_SIZE                    EQU        20                    ; number of NBP table entries 
  287. NBP_MAX_NAME_SIZE                EQU        28
  288.  
  289.  
  290. ;  Command codes 
  291.  
  292. TCPCreate                        EQU        30
  293. TCPPassiveOpen                    EQU        31
  294. TCPActiveOpen                    EQU        32
  295. TCPSend                            EQU        34
  296. TCPNoCopyRcv                    EQU        35
  297. TCPRcvBfrReturn                    EQU        36
  298. TCPRcv                            EQU        37
  299. TCPClose                        EQU        38
  300. TCPAbort                        EQU        39
  301. TCPStatus                        EQU        40
  302. TCPExtendedStat                    EQU        41
  303. TCPRelease                        EQU        42
  304. TCPGlobalInfo                    EQU        43
  305. TCPCtlMax                        EQU        49
  306.  
  307. TCPClosing                        EQU        1
  308. TCPULPTimeout                    EQU        2
  309. TCPTerminate                    EQU        3
  310. TCPDataArrival                    EQU        4
  311. TCPUrgent                        EQU        5
  312. TCPICMPReceived                    EQU        6
  313. lastEvent                        EQU        32767
  314. ; typedef unsigned short                 TCPEventCode
  315.  
  316.  
  317. TCPRemoteAbort                    EQU        2
  318. TCPNetworkFailure                EQU        3
  319. TCPSecPrecMismatch                EQU        4
  320. TCPULPTimeoutTerminate            EQU        5
  321. TCPULPAbort                        EQU        6
  322. TCPULPClose                        EQU        7
  323. TCPServiceError                    EQU        8
  324. lastReason                        EQU        32767
  325. ; typedef unsigned short                 TCPTerminationReason
  326.  
  327. ; typedef unsigned short                 tcp_port
  328.  
  329. ;  ValidityFlags 
  330.  
  331. timeoutValue                    EQU        $80
  332. timeoutAction                    EQU        $40
  333. typeOfService                    EQU        $20
  334. precedence                        EQU        $10
  335. ;  TOSFlags 
  336.  
  337. lowDelay                        EQU        $01
  338. throughPut                        EQU        $02
  339. reliability                        EQU        $04
  340. TCPCreatePB                RECORD 0
  341. rcvBuff                     ds.l    1                ; offset: $0 (0)
  342. rcvBuffLen                 ds.l    1                ; offset: $4 (4)
  343. notifyProc                 ds.l    1                ; offset: $8 (8)
  344. userDataPtr                 ds.l    1                ; offset: $C (12)
  345. sizeof                     EQU *                    ; size:   $10 (16)
  346.                         ENDR
  347. TCPOpenPB                RECORD 0
  348. ulpTimeoutValue             ds.b    1                ; offset: $0 (0)
  349. ulpTimeoutAction         ds.b    1                ; offset: $1 (1)
  350. validityFlags             ds.b    1                ; offset: $2 (2)
  351. commandTimeoutValue         ds.b    1                ; offset: $3 (3)
  352. remoteHost                 ds.l    1                ; offset: $4 (4)
  353. remotePort                 ds.w    1                ; offset: $8 (8)
  354. localHost                 ds.l    1                ; offset: $A (10)
  355. localPort                 ds.w    1                ; offset: $E (14)
  356. tosFlags                 ds.b    1                ; offset: $10 (16)
  357. precedence                 ds.b    1                ; offset: $11 (17)
  358. dontFrag                 ds.b    1                ; offset: $12 (18)
  359. timeToLive                 ds.b    1                ; offset: $13 (19)
  360. security                 ds.b    1                ; offset: $14 (20)
  361. optionCnt                 ds.b    1                ; offset: $15 (21)
  362. options                     ds.b    40                ; offset: $16 (22)
  363. userDataPtr                 ds.l    1                ; offset: $3E (62)
  364. sizeof                     EQU *                    ; size:   $42 (66)
  365.                         ENDR
  366.  
  367. TCPSendPB                RECORD 0
  368. ulpTimeoutValue             ds.b    1                ; offset: $0 (0)
  369. ulpTimeoutAction         ds.b    1                ; offset: $1 (1)
  370. validityFlags             ds.b    1                ; offset: $2 (2)
  371. pushFlag                 ds.b    1                ; offset: $3 (3)
  372. urgentFlag                 ds.b    1                ; offset: $4 (4)
  373. filler                     ds.b    1                ; offset: $5 (5)        ;  Filler for proper byte alignment     
  374. wdsPtr                     ds.l    1                ; offset: $6 (6)
  375. sendFree                 ds.l    1                ; offset: $A (10)
  376. sendLength                 ds.w    1                ; offset: $E (14)
  377. userDataPtr                 ds.l    1                ; offset: $10 (16)
  378. sizeof                     EQU *                    ; size:   $14 (20)
  379.                         ENDR
  380.  
  381. ;  for receive and return rcv buff calls 
  382. ;    Note: the filler in the following structure is in a different location than 
  383. ;          that specified in the Programmer's Guide.  
  384. TCPReceivePB            RECORD 0
  385. commandTimeoutValue         ds.b    1                ; offset: $0 (0)
  386. markFlag                 ds.b    1                ; offset: $1 (1)
  387. urgentFlag                 ds.b    1                ; offset: $2 (2)
  388. filler                     ds.b    1                ; offset: $3 (3)        ;  Filler for proper byte alignment  
  389. rcvBuff                     ds.l    1                ; offset: $4 (4)
  390. rcvBuffLen                 ds.w    1                ; offset: $8 (8)
  391. rdsPtr                     ds.l    1                ; offset: $A (10)
  392. rdsLength                 ds.w    1                ; offset: $E (14)
  393. secondTimeStamp             ds.w    1                ; offset: $10 (16)
  394. userDataPtr                 ds.l    1                ; offset: $12 (18)
  395. sizeof                     EQU *                    ; size:   $16 (22)
  396.                         ENDR
  397.  
  398. TCPClosePB                RECORD 0
  399. ulpTimeoutValue             ds.b    1                ; offset: $0 (0)
  400. ulpTimeoutAction         ds.b    1                ; offset: $1 (1)
  401. validityFlags             ds.b    1                ; offset: $2 (2)
  402. filler                     ds.b    1                ; offset: $3 (3)        ;  Filler for proper byte alignment     
  403. userDataPtr                 ds.l    1                ; offset: $4 (4)
  404. sizeof                     EQU *                    ; size:   $8 (8)
  405.                         ENDR
  406. HistoBucket                RECORD 0
  407. value                     ds.w    1                ; offset: $0 (0)
  408. counter                     ds.l    1                ; offset: $2 (2)
  409. sizeof                     EQU *                    ; size:   $6 (6)
  410.                         ENDR
  411.  
  412. NumOfHistoBuckets                EQU        7
  413. TCPConnectionStats        RECORD 0
  414. dataPktsRcvd             ds.l    1                ; offset: $0 (0)
  415. dataPktsSent             ds.l    1                ; offset: $4 (4)
  416. dataPktsResent             ds.l    1                ; offset: $8 (8)
  417. bytesRcvd                 ds.l    1                ; offset: $C (12)
  418. bytesRcvdDup             ds.l    1                ; offset: $10 (16)
  419. bytesRcvdPastWindow         ds.l    1                ; offset: $14 (20)
  420. bytesSent                 ds.l    1                ; offset: $18 (24)
  421. bytesResent                 ds.l    1                ; offset: $1C (28)
  422. numHistoBuckets             ds.w    1                ; offset: $20 (32)
  423. sentSizeHisto             ds.b    7 * HistoBucket.sizeof ; offset: $22 (34)
  424. lastRTT                     ds.w    1                ; offset: $4C (76)
  425. tmrSRTT                     ds.w    1                ; offset: $4E (78)
  426. rttVariance                 ds.w    1                ; offset: $50 (80)
  427. tmrRTO                     ds.w    1                ; offset: $52 (82)
  428. sendTries                 ds.b    1                ; offset: $54 (84)
  429. sourchQuenchRcvd         ds.b    1                ; offset: $55 (85)
  430. sizeof                     EQU *                    ; size:   $56 (86)
  431.                         ENDR
  432. TCPStatusPB                RECORD 0
  433. ulpTimeoutValue             ds.b    1                ; offset: $0 (0)
  434. ulpTimeoutAction         ds.b    1                ; offset: $1 (1)
  435. unused                     ds.l    1                ; offset: $2 (2)
  436. remoteHost                 ds.l    1                ; offset: $6 (6)
  437. remotePort                 ds.w    1                ; offset: $A (10)
  438. localHost                 ds.l    1                ; offset: $C (12)
  439. localPort                 ds.w    1                ; offset: $10 (16)
  440. tosFlags                 ds.b    1                ; offset: $12 (18)
  441. precedence                 ds.b    1                ; offset: $13 (19)
  442. connectionState             ds.b    1                ; offset: $14 (20)
  443. filler                     ds.b    1                ; offset: $15 (21)        ;  Filler for proper byte alignment     
  444. sendWindow                 ds.w    1                ; offset: $16 (22)
  445. rcvWindow                 ds.w    1                ; offset: $18 (24)
  446. amtUnackedData             ds.w    1                ; offset: $1A (26)
  447. amtUnreadData             ds.w    1                ; offset: $1C (28)
  448. securityLevelPtr         ds.l    1                ; offset: $1E (30)
  449. sendUnacked                 ds.l    1                ; offset: $22 (34)
  450. sendNext                 ds.l    1                ; offset: $26 (38)
  451. congestionWindow         ds.l    1                ; offset: $2A (42)
  452. rcvNext                     ds.l    1                ; offset: $2E (46)
  453. srtt                     ds.l    1                ; offset: $32 (50)
  454. lastRTT                     ds.l    1                ; offset: $36 (54)
  455. sendMaxSegSize             ds.l    1                ; offset: $3A (58)
  456. connStatPtr                 ds.l    1                ; offset: $3E (62)
  457. userDataPtr                 ds.l    1                ; offset: $42 (66)
  458. sizeof                     EQU *                    ; size:   $46 (70)
  459.                         ENDR
  460. TCPAbortPB                RECORD 0
  461. userDataPtr                 ds.l    1                ; offset: $0 (0)
  462. sizeof                     EQU *                    ; size:   $4 (4)
  463.                         ENDR
  464. TCPParam                RECORD 0
  465. tcpRtoA                     ds.l    1                ; offset: $0 (0)
  466. tcpRtoMin                 ds.l    1                ; offset: $4 (4)
  467. tcpRtoMax                 ds.l    1                ; offset: $8 (8)
  468. tcpMaxSegSize             ds.l    1                ; offset: $C (12)
  469. tcpMaxConn                 ds.l    1                ; offset: $10 (16)
  470. tcpMaxWindow             ds.l    1                ; offset: $14 (20)
  471. sizeof                     EQU *                    ; size:   $18 (24)
  472.                         ENDR
  473. TCPStats                RECORD 0
  474. tcpConnAttempts             ds.l    1                ; offset: $0 (0)
  475. tcpConnOpened             ds.l    1                ; offset: $4 (4)
  476. tcpConnAccepted             ds.l    1                ; offset: $8 (8)
  477. tcpConnClosed             ds.l    1                ; offset: $C (12)
  478. tcpConnAborted             ds.l    1                ; offset: $10 (16)
  479. tcpOctetsIn                 ds.l    1                ; offset: $14 (20)
  480. tcpOctetsOut             ds.l    1                ; offset: $18 (24)
  481. tcpOctetsInDup             ds.l    1                ; offset: $1C (28)
  482. tcpOctetsRetrans         ds.l    1                ; offset: $20 (32)
  483. tcpInputPkts             ds.l    1                ; offset: $24 (36)
  484. tcpOutputPkts             ds.l    1                ; offset: $28 (40)
  485. tcpDupPkts                 ds.l    1                ; offset: $2C (44)
  486. tcpRetransPkts             ds.l    1                ; offset: $30 (48)
  487. sizeof                     EQU *                    ; size:   $34 (52)
  488.                         ENDR
  489. ; typedef StreamPtr *                    StreamPPtr
  490.  
  491. TCPGlobalInfoPB            RECORD 0
  492. tcpParamPtr                 ds.l    1                ; offset: $0 (0)
  493. tcpStatsPtr                 ds.l    1                ; offset: $4 (4)
  494. tcpCDBTable                 ds.l    1                ; offset: $8 (8) <-- really an array of length one
  495. userDataPtr                 ds.l    1                ; offset: $C (12)
  496. maxTCPConnections         ds.w    1                ; offset: $10 (16)
  497. sizeof                     EQU *                    ; size:   $12 (18)
  498.                         ENDR
  499.  
  500.  
  501. TCPiopb                    RECORD 0
  502. fill12                     ds.b    12                ; offset: $0 (0)
  503. ioCompletion             ds.l    1                ; offset: $C (12)
  504. ioResult                 ds.w    1                ; offset: $10 (16)
  505. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  506. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  507. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  508. csCode                     ds.w    1                ; offset: $1A (26)
  509. tcpStream                 ds.l    1                ; offset: $1C (28)
  510. create                     ds        TCPCreatePB        ; offset: $20 (32)
  511.                          ORG 32
  512. open                     ds        TCPOpenPB        ; offset: $20 (32)
  513.                          ORG 32
  514. send                     ds        TCPSendPB        ; offset: $20 (32)
  515.                          ORG 32
  516. receive                     ds        TCPReceivePB    ; offset: $20 (32)
  517.                          ORG 32
  518. close                     ds        TCPClosePB        ; offset: $20 (32)
  519.                          ORG 32
  520. abort                     ds        TCPAbortPB        ; offset: $20 (32)
  521.                          ORG 32
  522. status                     ds        TCPStatusPB        ; offset: $20 (32)
  523.                          ORG 32
  524. globalInfo                 ds        TCPGlobalInfoPB ; offset: $20 (32)
  525.                          ORG 102
  526. sizeof                     EQU *                    ; size:   $66 (102)
  527.                         ENDR
  528.  
  529. UDPCreate                        EQU        20
  530. UDPRead                            EQU        21
  531. UDPBfrReturn                    EQU        22
  532. UDPWrite                        EQU        23
  533. UDPRelease                        EQU        24
  534. UDPMaxMTUSize                    EQU        25
  535. UDPStatus                        EQU        26
  536. UDPMultiCreate                    EQU        27
  537. UDPMultiSend                    EQU        28
  538. UDPMultiRead                    EQU        29
  539. UDPCtlMax                        EQU        29
  540.  
  541. UDPDataArrival                    EQU        1
  542. UDPICMPReceived                    EQU        2
  543. lastUDPEvent                    EQU        32767
  544. ; typedef unsigned short                 UDPEventCode
  545.  
  546. ; typedef unsigned short                 udp_port
  547.  
  548. ;  for create and release calls 
  549. UDPCreatePB                RECORD 0
  550. rcvBuff                     ds.l    1                ; offset: $0 (0)
  551. rcvBuffLen                 ds.l    1                ; offset: $4 (4)
  552. notifyProc                 ds.l    1                ; offset: $8 (8)
  553. localPort                 ds.w    1                ; offset: $C (12)
  554. userDataPtr                 ds.l    1                ; offset: $E (14)
  555. endingPort                 ds.w    1                ; offset: $12 (18)
  556. sizeof                     EQU *                    ; size:   $14 (20)
  557.                         ENDR
  558. UDPSendPB                RECORD 0
  559. reserved                 ds.w    1                ; offset: $0 (0)
  560. remoteHost                 ds.l    1                ; offset: $2 (2)
  561. remotePort                 ds.w    1                ; offset: $6 (6)
  562. wdsPtr                     ds.l    1                ; offset: $8 (8)
  563. checkSum                 ds.b    1                ; offset: $C (12)
  564. filler                     ds.b    1                ; offset: $D (13)        ;  Filler for proper byte alignment     
  565. sendLength                 ds.w    1                ; offset: $E (14)
  566. userDataPtr                 ds.l    1                ; offset: $10 (16)
  567. localPort                 ds.w    1                ; offset: $14 (20)
  568. sizeof                     EQU *                    ; size:   $16 (22)
  569.                         ENDR
  570. ;  for receive and buffer return calls 
  571. UDPReceivePB            RECORD 0
  572. timeOut                     ds.w    1                ; offset: $0 (0)
  573. remoteHost                 ds.l    1                ; offset: $2 (2)
  574. remotePort                 ds.w    1                ; offset: $6 (6)
  575. rcvBuff                     ds.l    1                ; offset: $8 (8)
  576. rcvBuffLen                 ds.w    1                ; offset: $C (12)
  577. secondTimeStamp             ds.w    1                ; offset: $E (14)
  578. userDataPtr                 ds.l    1                ; offset: $10 (16)
  579. destHost                 ds.l    1                ; offset: $14 (20)        ;  only for use with multi rcv 
  580. destPort                 ds.w    1                ; offset: $18 (24)        ;  only for use with multi rcv 
  581. sizeof                     EQU *                    ; size:   $1A (26)
  582.                         ENDR
  583. UDPMTUPB                RECORD 0
  584. mtuSize                     ds.w    1                ; offset: $0 (0)
  585. remoteHost                 ds.l    1                ; offset: $2 (2)
  586. userDataPtr                 ds.l    1                ; offset: $6 (6)
  587. sizeof                     EQU *                    ; size:   $A (10)
  588.                         ENDR
  589.  
  590.  
  591. UDPiopb                    RECORD 0
  592. fill12                     ds.b    12                ; offset: $0 (0)
  593. ioCompletion             ds.l    1                ; offset: $C (12)
  594. ioResult                 ds.w    1                ; offset: $10 (16)
  595. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  596. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  597. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  598. csCode                     ds.w    1                ; offset: $1A (26)
  599. udpStream                 ds.l    1                ; offset: $1C (28)
  600. create                     ds        UDPCreatePB        ; offset: $20 (32)
  601.                          ORG 32
  602. send                     ds        UDPSendPB        ; offset: $20 (32)
  603.                          ORG 32
  604. receive                     ds        UDPReceivePB    ; offset: $20 (32)
  605.                          ORG 32
  606. mtu                         ds        UDPMTUPB        ; offset: $20 (32)
  607.                          ORG 58
  608. sizeof                     EQU *                    ; size:   $3A (58)
  609.                         ENDR
  610.  
  611.     ENDIF ; __MACTCP__ 
  612.  
  613.